﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>简简单单网 密码安全</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<meta content="打分交友,约会交友,同城交友,北京交友,上海交友,位置交友,简单交友,简简单单,在线交友,聊天交友,交友" name="keywords" />
<meta content="打分，聊天，约会！简简单单，打分交友，一个给你打分，并帮你结识新朋友的网站。 会员之间通过互相之间的照片打分，建立第一印象，轻松进行约会交友，同城交友！" name="description" />
<link href="{$urlstatic2}/css/head_global_main_ask.css{$urltail}" rel="stylesheet" type="text/css" />
<script language="javascript" src="{$urlstatic2}/js/global_jquery_hello_dialog_chat.js{$urltail}"></script>
</head>
<body>
<php>$nav = 99;</php>
<include file="Public:head" />
<div class="container_cwrap clear">
  <!--左边部分开始-->
  <include file="Public:profile_left" />
  <!--左边部分结束-->
  <!--左边部分结束-->
  <!--右边部分开始-->
  <div class="newperphoto_r">
    <div class="shop_box">
      <div class="title_nav">
        <ul class="clear">
		  <li><a id="rsync" class="currt2"  href="{$urlsite}/user/password/">密码安全</a></li>
          <li><a id="rsync" class="currt1"  href="{$urlsite}/user/rsync/">同步设置</a></li>
		  <li><a id="rsync" class="currt1"  href="{$urlsite}/user/invite/">邀请有奖</a></li>
        </ul>
      </div>
	  <div class="set_box">
	    <p>更改密码时，请选择易于您记忆并不易被他人猜到的密码。</p>
	    <div class="set_box_main" style="width:820px;">
		  <div class="clear">
			  <b class="fl"><img alt="" src="{$urlstatic}/img/ico_set_img1.png?gv=124_1"></b>
			  <div class="box_r fl">
				<input type="password" value="" size="16" name="password" id="password">&nbsp;<span class="f_9">(QQ登录注册的用户密码为空)</span>
				<p class="list">请输入您的当前密码</p>
			  </div>
		  </div>
		  <div class="clear">
			  <b class="fl">新密码</b>
			  <div class="fl">
				<input type="password" value="" size="16" name="new_password" id="new_password">
				<p class="list">密码至少是6个字符</p>
			  </div>
		  </div>
		  <div class="clear">
			  <b class="fl">再次输入新密码</b>
			  <div class="fl">
				<input type="password" value="" size="16" name="new_password_repeat" id="new_password_repeat">
			  </div>
		  </div>
		  <div class="opt clear">
			  <b class="fl">&nbsp;</b>
			  <div class="fl">
				<a class="btn1 btn_b1" id="set_password_btn" onclick="set_password()">更改密码</a>
			  </div>
		  </div>
	    </div>
      </div>
    </div>
  </div>
  <!--右边部分结束-->
</div>
<script type="text/javascript">
function set_password()
{
	if($("#new_password").val() == ""){
		Win.dialog({type:'alert',msg:'登录新密码不能为空!',height:120,enter:function(){ $("#new_password").select(); }});
		return false;
	}
	
	var patn_password = /^[a-zA-Z0-9_]{6,16}$/;
	if(!patn_password.test($("#new_password").val()))
	{
		Win.dialog({type:'alert',msg:'密码只能为6-16位英文或数字.',height:120,enter:function(){  $("#new_password").select(); }});
		return false;
	}
	
	if($("#new_password_repeat").val() != $("#new_password").val()){
		Win.dialog({type:'alert',msg:'两次新密码输入必须一致!',height:120,enter:function(){  $("#new_password_repeat").select(); }});
		return false;
	}
	
	/*if($("#password").val() == ""){
		Win.dialog({type:'alert',msg:'当前登录密码不能为空!',height:120,enter:function(){  $("#password").select(); }});
		return false;
	}*/
	
	$('#set_password_btn').attr('disabled',true);
    $.ajax({
	   type: "POST",
	   url: "/index.php?s=/user/change_password/",
	   data: 'new_password='+$("#new_password").val()+'&password='+$("#password").val(),
	   success: function reply_success(re)
				{
					switch(re)
					{
						case '-1': //
								Win.dialog({type:'alert',msg:'参数不能为空！',height:120,cancel:function(){ $('#set_password_btn').attr('disabled',false);},enter:function(){ $('#set_password_btn').attr('disabled',false); }});
								break;
						case '-2'://
								Win.dialog({type:'alert',msg:'登录帐号不对！',height:120,cancel:function(){ $('#set_password_btn').attr('disabled',false);},enter:function(){ $('#set_password_btn').attr('disabled',false); }});
								break;
						case '-3'://
								Win.dialog({type:'alert',msg:'原始密码错误！',height:120,cancel:function(){ $('#set_password_btn').attr('disabled',false);},enter:function(){ $('#set_password_btn').attr('disabled',false); }});
								break;
						case '1'://
								Win.dialog({type:'alert',msg:'密码修改成功！',width:350,height:120,enter:function() {location.reload(true);},cancel:function() {location.reload(true);} });
								break;
					}
					$('#set_password_btn').attr('disabled',false);
					
				}
	});
}
</script>
<include file="Public:foot" />
</div>
</body>
</html>
